<template>
  <div
    class="w-[100%]"
    style="height: calc(100% - 50px)"
    v-if="hasPerm(['system:grafana'])"
  >
    <iframe class="w-[100%] h-[100%]" :src="grafanaUrl"></iframe>
  </div>
  <div
    class="w-[100%] flex items-center"
    style="height: calc(100% - 50px)"
    v-else
  >
    <a-empty>
      <template #image>
        <icon-close-circle-fill />
      </template>
      <span>暂无访问权限，请联系管理员分配权限</span>
    </a-empty>
  </div>
</template>
<script setup>
import axios from "axios";
import { onMounted, ref } from "vue";
import { hasPerm } from "~/utils/sys.js";

const grafanaUrl = ref(
  "http://localhost:3000/d/cea4n6b1ha8sgc/jvm-micrometer?orgId=1&from=now-24h&to=now&timezone=browser&var-application=&var-instance=127.0.0.1:9091&var-jvm_memory_pool_heap=$__all&var-jvm_memory_pool_nonheap=$__all&var-jvm_buffer_pool=$__all&refresh=30s"
);
</script>
<style scoped></style>
